<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>02-v-if</title>
</head>
<body>
    <div id="app">
        <!--
            === 三个等号在 JS 中表示绝对等于（就是数据与类型都要相等）
        -->
        <h1 v-if="type === 'A'">A</h1>
        <h1 v-else-if="type === 'B'">ttt</h1>
        <h1 v-else-if="type === 'C'">C</h1>
        <h1 v-else>who</h1>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                type: 'B' 
            } }) 
    </script>
    </body>
</html>